package com.hfzy.ihk.facade.calldata.enums;

import com.hfzy.ihk.common.facade.CustomEnumType;

import java.util.HashMap;
import java.util.Map;

/**
 * @author wws
 */
public enum MainCallType implements CustomEnumType {

    MAIN_CALL_PHONE_IS_CUSTOMER("0","主叫号码是客户号码"),
    MAIN_CALL_PHONE_IS_SALES("1","主叫号码是经纪号码");

    private MainCallType(String value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    private String value;

    private String desc;
    @Override
    public String getValue() {
        return value;
    }
    @Override
    public String getDesc() {
        return desc;
    }

    private static Map<String, MainCallType> map = new HashMap<>();
    static {
        for (MainCallType value : MainCallType.values()) {
            map.put(value.getValue(), value);
        }
    }

    public static MainCallType fromValue(String value) {
        MainCallType ret = map.get(value);
        if (ret != null) {
            return ret;
        } else {
            throw new IllegalArgumentException("No enum const " + MainCallType.class + "." + value);
        }
    }

}
